<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SWM34S_LVGL7.11_SWMUI: C:/Users/DELL/Desktop/Commit/lvgl/SWM34S_LVGL7.11_SWMUI_20230515/APP/Common Module/log.c 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">SWM34S_LVGL7.11_SWMUI<span id="projectnumber">&#160;V7.9</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.5 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_0ca16891106f5a3e9ad635a0d6c5f98f.html">APP</a></li><li class="navelem"><a class="el" href="dir_df4e0e4e72f77ab290fd1a24f190250a.html">Common Module</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">log.c</div></div>
</div><!--header-->
<div class="contents">
<a href="log_8c.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="preprocessor">#include &quot;<a class="code" href="log_8h.html">log.h</a>&quot;</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span><span class="preprocessor">#include &quot;lvgl.h&quot;</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span> </div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"><a class="line" href="log_8c.html#afe12af7fba29f5c026af71dfca1d1ff9">   32</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="log_8c.html#afe12af7fba29f5c026af71dfca1d1ff9">lvgl_show_error</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *text)</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span>{</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span>    <span class="keywordflow">if</span> (NULL == text)</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span>        <span class="keywordflow">return</span>; <span class="comment">// assert</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span>    lv_obj_t *error_text = lv_label_create(lv_scr_act(), NULL);</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span>    lv_label_set_recolor(error_text, <span class="keyword">true</span>);                                                          <span class="comment">// 允许 label 文字重新着色</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span>    lv_label_set_text(error_text, LV_SYMBOL_CLOSE);                                                  <span class="comment">// 设置错误提示标志</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span>    lv_label_ins_text(error_text, LV_LABEL_POS_LAST, text);                                          <span class="comment">// 在指定位置追加文本</span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span>    lv_obj_align(error_text, NULL, LV_ALIGN_IN_LEFT_MID, LV_HOR_RES_MAX / 10, -LV_VER_RES_MAX / 10); <span class="comment">// 内部靠左居中</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span>    <span class="keywordflow">for</span> (;;)</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span>        lv_task_handler();</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span>}</div>
<div class="ttc" id="alog_8c_html_afe12af7fba29f5c026af71dfca1d1ff9"><div class="ttname"><a href="log_8c.html#afe12af7fba29f5c026af71dfca1d1ff9">lvgl_show_error</a></div><div class="ttdeci">void lvgl_show_error(const char *text)</div><div class="ttdoc">应用 label 控件在屏幕上显示错误告警</div><div class="ttdef"><b>Definition:</b> <a href="log_8c_source.html#l00032">log.c:32</a></div></div>
<div class="ttc" id="alog_8h_html"><div class="ttname"><a href="log_8h.html">log.h</a></div><div class="ttdoc">日志打印/用户提示(告警)</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5
</small></address>
</body>
</html>
